<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #test{
            width: 100px;
            background: red;
        }
    </style>
</head>
<body>
    <div id="test" style="height:100px;">

    </div>
    <!-- string--number; 
    parseInt();
    parseFloat();
    Tip:第一位必须为数字-->
    <script>
        var test = document.getElementById("test");
        var height = test.style.height;
        console.log(parseInt(height));
        var a = "12px";
        var b = "a13px";
        var c = "13.45px";
        console.log(parseInt(a));
        console.log(parseInt(b));
        console.log(parseInt(c));
        console.log(parseFloat(c));
        test.onclick = function(){
            this.style.height = parseInt(this.style.height)+1+"px";
            console.log(parseInt(this.style.height));
        }
        
    </script>
</body>
</html>